import http from '@/utils/axios'

export default {
  getTable(pram) {
    let ur = ''
    if (pram.groupId) {
      ur += '&groupId=' + pram.groupId
    }
    if (pram.tag) {
      ur += '&tag=' + pram.tag
    }
    if (pram.topic) {
      ur += '&topic=' + pram.topic
    }
    if (pram.listenerUrl) {
      ur += '&listenerUrl=' + pram.listenerUrl
    }
    return http({
      url: `/management-general/messageConfig/page?pageNo=${pram.pageNo}&pageSize=${pram.pageSize}${ur}`,
      method: 'get',
    })
  },
  getDetail(pram) {
    let ur = ''
    if (pram.groupId) {
      ur += '&groupId=' + pram.groupId
    }
    if (pram.tag) {
      ur += '&tag=' + pram.tag
    }
    if (pram.topic) {
      ur += '&topic=' + pram.topic
    }
    if (pram.listenerUrl) {
      ur += '&listenerUrl=' + pram.listenerUrl
    }
    // pageNo=${pram.pageNo}&pageSize=${pram.pageSize}&
    return http({
      url: `/management-general/messageConfig/detailPage?configId=${pram.configId}${ur}`,
      method: 'get',
    })
  },
}
